<?php

declare( strict_types = 1 );

namespace App\Exception\Formatter;

use App\Common as com;
use Throwable;
use Hyperf\ExceptionHandler\Formatter\FormatterInterface;

class DefaultFormatter implements FormatterInterface {

	public function format( Throwable $throwable ):string {
		return sprintf( "%s:%s(%s) in %s:%s\nStack trace:\n%s\n【simpleShowExceptionInfo2】\n\n%s", get_class( $throwable ), $throwable->getMessage(), $throwable->getCode(), $throwable->getFile(), $throwable->getLine(), $throwable->getTraceAsString(), com\Lib\Err\Exception::getSimpleShowExceptionInfo( $throwable ) );
	}

}
